<!DOCTYPE html>
<html lang="zh">
<head>
    <meta charset="UTF-8">
    <title> 海盗战利品 </title>
    <script>
        function showCoords(eventObj) {
            var coords = document.getElementById("coords");
            var x = eventObj.clientX;
            var y = eventObj.clientY;
            coords.innerHTML = "地图坐标:" + x + ", " + y;
        }

        function init() {
            var map = document.getElementById("map");
            map.onmousemove = showCoords;
        }

        window.onload = init;
    </script>
</head>
<body>
<img id="map" src="map.jpg">
<p id="coords">移动鼠标以找到坐标……</p>
</body>
</html>